package com.supermap.ar.unity.slam;

import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;

/**
 * 相机姿态数据
 * @author tanyx 2022/3/3
 * @version 1.0
 * <br/>SampleCode:<br/>
 * <code>
 *
 * </code>
 **/
public class CameraPoseData {

    @SerializedName("positionX")
    private float positionX;
    @SerializedName("positionY")
    private float positionY;
    @SerializedName("positionZ")
    private float positionZ;

    @SerializedName("rotationX")
    private float rotationX;
    @SerializedName("rotationY")
    private float rotationY;
    @SerializedName("rotationZ")
    private float rotationZ;
    @SerializedName("rotationW")
    private float rotationW;

    @SerializedName("near")
    private float near;
    @SerializedName("far")
    private float far;
    @SerializedName("aspect")
    private float aspect;

    @SerializedName("fov")
    private float fov;

    /**
     * 将对象转换为json字符串
     * @return
     */
    public String toJson(){
        return new Gson().toJson(this);
    }

    public static CameraPoseData getObject(String jsonStr){
        return new Gson().fromJson(jsonStr, CameraPoseData.class);
    }

    public float getPositionX() {
        return positionX;
    }

    public void setPositionX(float positionX) {
        this.positionX = positionX;
    }

    public float getPositionY() {
        return positionY;
    }

    public void setPositionY(float positionY) {
        this.positionY = positionY;
    }

    public float getPositionZ() {
        return positionZ;
    }

    public void setPositionZ(float positionZ) {
        this.positionZ = positionZ;
    }

    public float getRotationX() {
        return rotationX;
    }

    public void setRotationX(float rotationX) {
        this.rotationX = rotationX;
    }

    public float getRotationY() {
        return rotationY;
    }

    public void setRotationY(float rotationY) {
        this.rotationY = rotationY;
    }

    public float getRotationZ() {
        return rotationZ;
    }

    public void setRotationZ(float rotationZ) {
        this.rotationZ = rotationZ;
    }

    public float getRotationW() {
        return rotationW;
    }

    public void setRotationW(float rotationW) {
        this.rotationW = rotationW;
    }

    public float getNear() {
        return near;
    }

    public void setNear(float near) {
        this.near = near;
    }

    public float getFar() {
        return far;
    }

    public void setFar(float far) {
        this.far = far;
    }

    public float getAspect() {
        return aspect;
    }

    public void setAspect(float aspect) {
        this.aspect = aspect;
    }

    public float getFov() {
        return fov;
    }

    public void setFov(float fov) {
        this.fov = fov;
    }
}
